import type { TableColumnsType } from 'ant-design-vue'

/**
 * 获取菜单管理表格列配置
 * @returns 表格列配置
 */
export const useTableColumns = () => {
  const { t } = useI18n()

  const columns: TableColumnsType = [
    {
      title: t('menu.name'),
      dataIndex: 'name',
      key: 'name',
      width: 180,
    },
    {
      title: t('menu.icon'),
      dataIndex: 'icon',
      key: 'icon',
      width: 80
    },
    {
      title: t('menu.type'),
      dataIndex: 'type',
      key: 'type',
      width: 100
    },
    {
      title: t('menu.path'),
      dataIndex: 'path',
      key: 'path',
      width: 180,
    },
    {
      title: t('menu.permission'),
      dataIndex: 'permission',
      key: 'permission',
      width: 180,
    },
    {
      title: t('menu.isVisible'),
      dataIndex: 'isVisible',
      key: 'isVisible',
      width: 100
    },
    {
      title: t('menu.status'),
      dataIndex: 'status',
      key: 'status',
      width: 100
    },
    {
      title: t('common.action'),
      key: 'action',
      width: 120,
      fixed: 'right'
    }
  ]

  return columns
}